package com.yxq.mdt.app.modules.personal.ui.anchor;

import android.content.Intent;
import android.os.Bundle;
import android.text.TextUtils;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;

import androidx.annotation.Nullable;

import com.yxq.mdt.app.R;
import com.yxq.mdt.app.base.BaseActivity;
import com.yxq.mdt.app.glide.GlideHelper;
import com.yxq.mdt.app.net.API;
import com.yxq.mdt.app.modules.webview.ui.MiWebViewActivity;

import butterknife.BindView;
import butterknife.OnClick;

/**
 * 认证成功的申请密聊信息
 */
public class PersonalWithdrawSucceedAc extends BaseActivity {

    @BindView(R.id.personal_withdraw_tv_web)
    TextView personalWithdrawTvWeb;
    @BindView(R.id.authentication_succeed_name)
    TextView authenticationSucceedName;
    @BindView(R.id.authentication_succeed_number)
    TextView authenticationSucceedNumber;
    @BindView(R.id.personal_withdraw_iv_front)
    ImageView personalWithdrawIvFront;
    @BindView(R.id.personal_withdraw_iv_back)
    ImageView personalWithdrawIvBack;

    @Override
    public int getLayoutId() {
        return R.layout.layout_binding_car_data_number;
    }

    @Override
    public void initView() {
        String name = getIntent().getStringExtra("name");
        String number = getIntent().getStringExtra("number");
        String frontImg = getIntent().getStringExtra("frontImg");
        String backImg = getIntent().getStringExtra("backImg");
        if (!TextUtils.isEmpty(name)) {
            authenticationSucceedName.setText(name);
        }
        if (!TextUtils.isEmpty(number)) {
            authenticationSucceedNumber.setText(number);
        }
        if (!TextUtils.isEmpty(frontImg)) {
            GlideHelper.load(mActivity, frontImg, personalWithdrawIvFront);
        }
        if (!TextUtils.isEmpty(backImg)) {
            GlideHelper.load(mActivity, backImg, personalWithdrawIvBack);
        }
    }

    @Override
    public void initData(@Nullable Bundle savedInstanceState) {

    }

    @OnClick(R.id.personal_withdraw_tv_web)
    public void onViewClicked(View view) {
        switch (view.getId()) {
            case R.id.personal_withdraw_tv_web:
                Intent intent = new Intent(mActivity, MiWebViewActivity.class);
                intent.putExtra("url", API.PRIVACY_POLICY);
                intent.putExtra("title", "隐私协议");
                startActivity(intent);
                break;
        }
    }
}
